package com.alibaba.controller;


import com.alibaba.annotation.Autowired;
import com.alibaba.annotation.Controller;
import com.alibaba.annotation.RequestMapping;
import com.alibaba.service.DemoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/demo")
public class DemoController {
    @Autowired
    private DemoService demoService;

    /**
     * URL:/demo/test
     */
    @RequestMapping("/test")
    public String query(String name, String pwd) {
        return demoService.get(name, pwd);
    }

    /**
     * URL:/demo/query
     */
    @RequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        return demoService.get(name);
    }
}